﻿namespace BlamanticUI.Components;

/// <summary>
/// Represents a section of item in <see cref="Breadcrumb"/> component.
/// </summary>
[CssClass("section")]
public class Section : BlazorChildComponentBase<Breadcrumb>, IHasActive,IHasChildContent
{
    /// <summary>
    /// Gets or sets a value indicating whether this state is actived.
    /// </summary>
    /// <value>
    ///   <c>true</c> if actived; otherwise, <c>false</c>.
    /// </value>
    [Parameter] public bool Active { get; set; }
    /// <summary>
    /// A segment of UI content to render.
    /// </summary>
    [Parameter]public RenderFragment? ChildContent { get; set; }

    /// <summary>
    /// Gets the tag name when has href attribute then return 'a', otherwise return 'div'.
    /// </summary>
    protected override string TagName => AdditionalAttributes.ContainsKey("href") ? "a" : "div";
}
